package com.listeningframework.boot.autoconfigure.template.thymeleaf.processors;

import java.util.List;

import org.thymeleaf.Arguments;
import org.thymeleaf.dom.Element;
import org.thymeleaf.dom.Node;
import org.thymeleaf.dom.Text;

import com.google.common.collect.Lists;
import com.listeningframework.boot.autoconfigure.template.thymeleaf.dialect.ListeningThymeleafProcessor;

public class HelloWorldProcessor extends ListeningThymeleafProcessor {

    public HelloWorldProcessor() {
        super("helloworld");
    }

    @Override
    protected List<Node> getMarkupSubstitutes(Arguments arguments, Element element) {
        final List<Node> nodes = Lists.newArrayList();
        nodes.add(new Text("hello world"));
        return nodes;
    }

    @Override
    public int getPrecedence() {
        return ATTR_PRECEDENCE;
    }

}
